﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Tong;
public partial class aspnet_admin_bock_Cx_GBookDoctorclass : System.Web.UI.Page
{
    TongUse TextData = new TongUse();

    protected void Page_Load(object sender, EventArgs e)
    {
       
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (CX_Doctor_Class_Name.Text != "" && CX_Doctor_Class_Name.Text.Length < 250 && TextData.SqlataSet("select CX_Doctor_Class_Name from  [CX_Doctor_Class] where CX_Doctor_Class_Name='" + CX_Doctor_Class_Name.Text.Trim() + "'").Tables[0].Rows.Count==0)
        {
            TextData.SqlDataSave("insert into [CX_Doctor_Class] (CX_Doctor_Class_Name) values('" + CX_Doctor_Class_Name.Text.Trim() + "')");
            tt.Text = "添加科室" + CX_Doctor_Class_Name.Text + "成功";
            GridView1.DataSourceID = "SqlDataSource1";
            GridView1.DataBind();
        }
        else
        {
            tt.Text = "输入的科室为空或超过250个或以存在相同科室";
            GridView1.DataSourceID = "SqlDataSource1";
            GridView1.DataBind();
        }
    }



}